<?
require_once("lib/php/controller/Controller.php");

abstract class RpcController implements Controller {
	public function doGet() {
		die("Error: RpcController::doGet not implemented.");
	}
	
	protected function getArguments($expectedNumParams) {
		$numParams = $_POST["numParams"];
		if ($numParams != $expectedNumParams) {
			die("Error: RpcController::getArguments(): Wrong number of arguments.");
		}
		
		$params = array();
		for ($i=0; $i<$numParams; ++$i) {
			array_push($params, $_POST["param$i"]);
		}
		
		return $params;
	}

	protected function printExpireHeader() {
		header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
		header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); 
		header("Cache-Control: no-cache, must-revalidate"); 
		header("Pragma: no-cache");
	}	
}
?>
